<%@ page language="java" import="java.util.*,com.imut.javabean.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>晓庄bbs——帖子区</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  <center><h2>欢迎访问晓庄bbs</h2></center>
    <br>
    <hr>
		<a href=newTitle.jsp>发表新的主题文章</a>
		<a href=login.jsp target=_parent>返回登录界面</a>
		<hr>
		
			<tbody>	
			<hr>
				<tr>
						<th width="15%" align="center" class="linel" scope="col" colspan="2">
						<b>帖子ID</b>
						</th>
			
						<th width="15%" align="center" scope="col" colspan="2">
						<b>帖子主题</b>
						</th>
						
						<th width="15%" align="center" scope="col" colspan="2">
						<b>发帖人</b>
						</th>
						
						<th width="15%" align="center" scope="col" colspan="2">
						<b>发帖时间</b>
						</th>
						
					</tr>
				<%
						ArrayList list=(ArrayList)request.getAttribute("list");
						if(list!=null){
							Iterator e=list.iterator();
							while(e.hasNext()){
								Post post=(Post)e.next();
						%>
			<hr>
				<tr>
					<td align="center" colspan="12">
					<%
						Integer pageCount=(Integer)request.getAttribute("pageCount");
						Integer curPage=(Integer)request.getAttribute("curPage");
						if(pageCount!=null&&curPage!=null){
							if(pageCount!=0&&curPage!=1){
					 %>
					 		<a href="listAllPostServlet?curPage=1"/>首页</a>
					 		<a href="listAllPostServlet?curPage=<%=curPage-1 %>"/></a>
				    <%
							}
					%>
					 		
					<%
							if(pageCount==0||curPage==1){
					%>
							首页	前一页
					<%
							}
					%>
			
					<%
					        if(pageCount!=0&&curPage!=pageCount){
					%>
					 		<a href="listAllTeacherServlet?curPage=<%=curPage+1 %>"/>下一页</a>
					 		<a href="listAllTeacherServlet?curPage=<%=pageCount%>"/>尾页</a>
				    <%
							}
					%>
					 		
					<%
							if(pageCount==0||curPage==pageCount){
					%>
							下一页		尾页
					<%
							}
					 %>
				        	&nbsp;
							第<%=curPage %>页/共<%=pageCount %>页
							&nbsp;
					<%
					     } 
					%>
			
					</td>
				</tr>
			</tbody>
			</table>
  </body>
</html>
